import request from '@/config/axios'

// 列表查询
export const getCompanyPage = async (data) => {
  return await request.post({ url: `/ent/company/get-list`, data })
}

// 获取近30天新增企业
export const getLatestCompanyList = async (data) => {
  return await request.post({ url: `/ent/company/get-latest`, data })
}

// 获取基本查询条件组合
export const getQueryCondition = async (data) => {
  return await request.post({ url: `/ent/company/get-condition`, data })
}

// 查询详情
export const getOne = async (params) => {
  return await request.get({ url: `/ent/company/get-one`, params })
}

// 查询详情-简单数据
export const getSimpleData = async (params) => {
  return await request.get({ url: `/ent/company/get-simple-data`, params })
}

/**
 * 查询单个节点详情
 * @param params {cid: string, field: string}
 * @returns
 */
export const getNode = async (params) => {
  return await request.get({ url: `/ent/company/get-node`, params })
}

/**
 * 上报查询记录
 * @param data
 * @returns
 */
export const searchReport = (data) => {
  return request.post({ url: `/ent/company/search-report`, data })
}

/**
 * 获取热门搜索记录
 * @param data
 * @returns
 */
export const getHotKey = () => {
  return request.get({ url: `/ent/company/get-hot-key` })
}

/**
 * 获取系统内置查询模板
 * @param params: { pageNo: -1, pageSize: 30} 默认条件
 * @returns
 */
export const getSystemTemplate = () => {
  return request.get({ url: `/ent/system-template/page`, params: { pageNo: -1 } })
}

// 企业跟进/领取数量
export const todayCout = async () => {
  return await request.get({ url: `/ent/statistics/today-count` })
}
